function [ L ] = loglikelihood( X,y,w,lambda )
L = -(1-y)'*(X*w); 
Xw1 = X*w; 
Xw1 = Xw1(X*w<0); 
L = L - sum(-Xw1 + log(1+exp(Xw1))); 
Xw2 = X*w; 
Xw2 = Xw2(X*w>0); 
L = L - sum(log(1+exp(-Xw2))); 
L = L - 0.5*lambda*(w'*w); 
end 
